<template>
    <el-dialog
        custom-class="travel-wallet-info"
        v-el-drag-dialog="{ drag: true, full: false, resize: false }"
        :visible="true"
        :close-on-click-modal="false"
        @close="closeMd"
        :title="`钱包信息`"
        width="500px">
        <el-form 
            v-if="obj"
            :label-width="'100px'"
            label-suffix="：">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="用户姓名">
                        {{ obj.baseUserId.realName }}
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="用户手机">
                        {{ obj.baseUserId.phone }}
                    </el-form-item>
                </el-col>
            </el-row>

            <el-row>
                <el-col :span="12">
                    <el-form-item label="账户余额">
                        {{ obj.cashBalance }} 元
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="押 金">
                        {{ obj.cashPledge }} 元
                    </el-form-item>
                </el-col>
            </el-row>

            <el-row>
                <el-col :span="12">
                    <el-form-item label="解冻巴士币">
                        {{ obj.shareMoney }} 元
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="冻结巴士币">
                        {{ obj.recomMoney }} 元
                    </el-form-item>
                </el-col>
            </el-row>

            <el-row>
                <el-col :span="12">
                    <el-form-item label="派单余额">
                        {{ obj.sendBalance }} 元
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="抢单余额">
                        {{ obj.grabBalance }} 元
                    </el-form-item>
                </el-col>
            </el-row>

        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button 
                type="info" 
                icon="el-icon-close" 
                @click="closeMd">
                关 闭
            </el-button>
        </div>
    </el-dialog>
</template>

<script>
import elDragDialog from '@/directive/el-drag-dialog';

import * as financeService from '@/api/services/travel/finance.service';

export default {
    name: 'TravelWalletInfo',
    directives: { elDragDialog },
    data() {
        return {
            // 钱包信息
            obj: null
        }
    },
    async created() {
        const that = this;

        // 获取旅行社钱包信息
        let res = await financeService.getWalletInfo();
        if(res.code === 1) that.obj = res.data;
        console.log('钱包信息', res);
    },
    methods:{
        closeMd() {
            this.$emit("myClick", {state: false});
        },
        
    },
 }
</script>
